package com.xtoneict.auth.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xtoneict.auth.entity.Holiday;
import com.xtoneict.auth.mapper.HolidayMapper;
import com.xtoneict.auth.service.IHolidayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class HolidayServiceImpl extends ServiceImpl<HolidayMapper, Holiday> implements IHolidayService {
    @Autowired
    private HolidayMapper holidayMapper;

    public char selectStatusByDate(Integer year, Integer month, Integer day){
        QueryWrapper<Holiday> holidayQueryWrapper = new QueryWrapper<>();
        holidayQueryWrapper.eq("year", year);
        holidayQueryWrapper.eq("month",month);
        holidayQueryWrapper.eq("day",day);

        Holiday holiday = holidayMapper.selectOne(holidayQueryWrapper);

        return holiday.getStatus();
    }
}
